import 'package:kkhousekeep/generated/json/base/json_field.dart';
import 'package:kkhousekeep/generated/json/home_notice_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class HomeNoticeEntity {
	late int code;
	late HomeNoticeObj obj;
	late String msg;

	HomeNoticeEntity();

	factory HomeNoticeEntity.fromJson(Map<String, dynamic> json) => $HomeNoticeEntityFromJson(json);

	Map<String, dynamic> toJson() => $HomeNoticeEntityToJson(this);

	HomeNoticeEntity copyWith({int? code, HomeNoticeObj? obj, String? msg}) {
		return HomeNoticeEntity()
			..code= code ?? this.code
			..obj= obj ?? this.obj
			..msg= msg ?? this.msg;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class HomeNoticeObj {
	late List<HomeNoticeObjList> list;
	late int total;

	HomeNoticeObj();

	factory HomeNoticeObj.fromJson(Map<String, dynamic> json) => $HomeNoticeObjFromJson(json);

	Map<String, dynamic> toJson() => $HomeNoticeObjToJson(this);

	HomeNoticeObj copyWith({List<HomeNoticeObjList>? list, int? total}) {
		return HomeNoticeObj()
			..list= list ?? this.list
			..total= total ?? this.total;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class HomeNoticeObjList {
	late int id;
	late String title;
	late String publisher;
	late String context;
	late int views;
	late String publishTime;
	late String createTime;
	late String updateTime;
	late int cid;
	late int read;

	HomeNoticeObjList();

	factory HomeNoticeObjList.fromJson(Map<String, dynamic> json) => $HomeNoticeObjListFromJson(json);

	Map<String, dynamic> toJson() => $HomeNoticeObjListToJson(this);

	HomeNoticeObjList copyWith({int? id, String? title, String? publisher, String? context, int? views, String? publishTime, String? createTime, String? updateTime, int? cid, int? read}) {
		return HomeNoticeObjList()
			..id= id ?? this.id
			..title= title ?? this.title
			..publisher= publisher ?? this.publisher
			..context= context ?? this.context
			..views= views ?? this.views
			..publishTime= publishTime ?? this.publishTime
			..createTime= createTime ?? this.createTime
			..updateTime= updateTime ?? this.updateTime
			..cid= cid ?? this.cid
			..read= read ?? this.read;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}